﻿#include <learn/painter/paint_ctx.h>
#include <learn/painter/shader.h>

using namespace xi;
using namespace xi::painter;

std::size_t Shader::_gen_id() noexcept
{
    static std::size_t id = 0;
    return id++;
}

Shader::Shader(std::function<Vec4f(int index)> vertexShader, std::function<Vec4f(void)> fragmentShader)
    : m_ID(_gen_id()), m_vertexShader(vertexShader), m_fragmentShader(fragmentShader)
{
}

void Shader::draw_primitive(int k)
{
    for (int i = 0; i < 3; i++)
    {
        auto v1 = m_vertexShader(k);
        auto v2 = m_vertexShader(k + 1);
        auto v3 = m_vertexShader(k + 2);
    }
}

void Shader::draw_elements(int count)
{
}
